Resource URLs


Flux searches for resources in the game's resource tree. The resource tree is defined by a series of search paths in the game's INI file. The paths specify roots of trees which are searched in sequence for each resource.

Typically, there will be a core resource tree, and then variations for language-specific content in separate directories. There may also be content from addons.

To locate resources, the game uses a URL-style mechanism. A resource URL looks like the following:
type:/path/to/file/filename

Notes:
The filename does not have an extension. The game infers the extension from the type of resource, and may be able to load several file types for one resource type (e.g. loading different image formats via the bitmap resource type.)

For certain types of data, which do not become objects, the resource manager is used to search for filenames directly. In this case the resource type should be the extension of the file to find. An example of this type of data is a ship template - it is used to define the ship and then thrown away. This is different to a texture, which is loaded from a file and then becomes a shared resource object in memory.

Resource URLs are not case sensitive. When a URL is specified to the game it is converted to lower case, and any backslash characters are converted to URL-style forward slashes. You can minimise the amount of work the game has to do by specifying resource URLs in this form, and ensure they are consistent with the look of everybody's code.

Example URLs
texture:/images/logos/flux

model:/avatars/command_section/CommandSectionRTO_T

ini:/sims/ships/player/comsec